package com.ls.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ls.pojo.Product;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author xiaotang
 * @since 2023-04-07
 */
public interface ProductMapper extends BaseMapper<Product> {



    @Update("update t_product set stock=stock-1 where  id = #{id} and stock>0")
    Integer updateStockById(Integer id);
}
